
# coding: utf-8

# In[1]:


import random


# In[11]:


num = 0
guess = random.randint(0,100)


# In[14]:


i = -1
while i != guess:
    try:
        i = int(input("猜猜是几"))
    except:
        print("输入内容必须为整数！")
        continue
    if i>guess:
        print("遗憾，太大了")
    elif i<guess:
        print("遗憾，太小了")
    else:
        print("预测{}次，你猜中了".format(num))
    num = num+1
    

